Learn about artificial intelligence (AI)
Language models, RAG and agents now power bots and apps. Understand the concepts, the costs and how to host AI applications.
Featured
- CostsHow much does an AI chatbot cost to build and run?Running an AI chatbot costs model tokens, hosting, a database and, with RAG, extra context per message. See how to estimate the cost per conversation.
- CostsHow much does a RAG system cost? Embeddings, database and LLMA RAG system has three costs: embeddings, a vector database and the LLM. See the math for 1,000 questions a day, with hypothetical prices, and where the bill grows.
- How-to guidesHow to build a Discord AI botBuild a Discord AI bot with discord.js: an /ask command, the API key in an environment variable, per-channel memory, Discord limits and how to host it.
Concepts5
- What is a vector database?A vector database stores embeddings (lists of numbers) and finds the items closest in meaning, not just in keywords. Learn how it works and when to use one.
- What is MCP (Model Context Protocol)?MCP is an open protocol that connects AI applications to external tools and data. See how it works, its parts, its transports, and a minimal server.
- What is prompt injection?Prompt injection is when untrusted text changes how an LLM behaves. Learn direct vs indirect attacks, real examples, and how to limit the damage in AI apps and bots.
- What is a large language model (LLM)?An LLM is an AI model trained on huge amounts of text to predict the next token. See how it works, what a context window is, why it hallucinates and when to use one.
- What is RAG?RAG (retrieval-augmented generation) finds relevant passages in your own data and gives them to an LLM with the question. Learn how it works and when to use it.
How-to guides5
- How to build a Discord AI botBuild a Discord AI bot with discord.js: an /ask command, the API key in an environment variable, per-channel memory, Discord limits and how to host it.
- How to host an AI chatbotAn AI chatbot is an API that takes messages, calls a language model and streams the reply back. Here is the code and how to put it online.
- How to host n8nHosting n8n means running its server on an always-on process with a public HTTPS URL, a database and a fixed encryption key. Here is the step by step.
- WhatsApp AI bot: architecture and costsA WhatsApp AI bot is a webhook that receives the message from the Cloud API, calls an LLM and replies. See the architecture, the FastAPI code and what it costs.
- Streaming AI responses to users (SSE)Stream LLM output to the browser with server-sent events: a Node.js endpoint, a fetch client that parses the stream, and fixes for buffering and dropped connections.
Costs3
- How much does an AI chatbot cost to build and run?Running an AI chatbot costs model tokens, hosting, a database and, with RAG, extra context per message. See how to estimate the cost per conversation.
- How much does a RAG system cost? Embeddings, database and LLMA RAG system has three costs: embeddings, a vector database and the LLM. See the math for 1,000 questions a day, with hypothetical prices, and where the bill grows.
- How much does an LLM API cost for your app?An LLM API bills per token, and output costs more than input. See a worked monthly estimate for a bot and practical ways to cut the bill.