PromptisePromptise
Docs
GitHub
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Guides> Library> Category

AI engineering guides: building AI agents in Python

These guides are about building software around language models: AI agents that call tools, the MCP servers that provide those tools, and everything needed to run them in production. Each one explains a concept and then shows runnable Python code using Promptise Foundry, an open-source agent framework, though the ideas carry over to other frameworks.

Topics run from a first agent and connecting MCP servers, through memory, retrieval, reasoning patterns and multi-agent systems, to guardrails, human approval, observability, evals, cost control and deployment. Beginner guides assume you know Python but not agents. For a guided route, the topic hubs put related guides in reading order.

[n.01/02]> 71 guides

Beginner15

  1. 01What Is MCP (Model Context Protocol)? A Developer's GuideWhat MCP is and how it works: hosts, clients, servers, tools, resources, transports and SDK 2.x. Build a small MCP server and connect an agent to it.Beginner · 18 minOct 18, 2026
  2. 02What Is an LLM Guardrail? Types, Examples and LimitsWhat an LLM guardrail is: a check on what goes into and out of a model. Input, output and tool guardrails, a real example, and what guardrails can't do.Beginner · 7 minOct 18, 2026
  3. 03OpenRouter AI Agent with MCP: Many Models in PromptiseBuild an OpenRouter AI agent with MCP tools: one key for many models, route only to providers that support tools, add attribution headers, and fix errors.Beginner · 11 minOct 18, 2026
  4. 04How to Run, Debug and Deploy an AI Agent in PythonRun, debug and deploy a Python AI agent project with one command: a package.json-style manifest, live traces, a terminal UI, JSON logs and an API.Beginner · 15 minOct 18, 2026
  5. 05What Is an AI Agent Framework? When You Need OneWhat an AI agent framework does: the tool loop, model access, limits, approvals and tracing. When you need one and when plain API calls are enough.Beginner · 7 minOct 18, 2026
  6. 06Gemini AI Agent with MCP: Use Google Models in PromptiseBuild a Gemini AI agent with MCP tools: get an AI Studio key, pick a current model id, set reasoning effort, use Vertex AI on Google Cloud, fix errors.Beginner · 11 minOct 18, 2026
  7. 07What Is an AI Agent? Definition, How It Works, ExamplesWhat an AI agent is: a model that calls tools in a loop until a goal is met. How the loop works, a real example, agents vs chatbots and workflows, FAQs.Beginner · 7 minOct 18, 2026
  8. 08Azure OpenAI Agent with MCP: Use Deployments in PromptiseBuild an Azure OpenAI agent with MCP tools: deployment vs model name, endpoint, API version or the v1 API, Entra ID sign-in, and fixes for common errors.Beginner · 12 minOct 18, 2026
  9. 09What Is Agentic RAG? How It Differs from Classic RAGWhat agentic RAG is: an agent decides when and what to search, searches again if needed and cites sources. How it works, an example, RAG vs agentic RAG.Beginner · 7 minOct 18, 2026
  10. 10What Is Tool Calling? LLM Function Calling ExplainedWhat tool calling (function calling) is: how an LLM asks your code to run a function, the JSON schema it sees, parallel calls, and how it differs from MCP.Beginner · 7 minOct 18, 2026
  11. 11Claude AI Agent with MCP: Use Anthropic Models in PromptiseBuild a Claude AI agent with MCP tools: set the Anthropic key and model id, use effort instead of temperature, add prompt caching, and fix common errors.Beginner · 11 minOct 18, 2026
  12. 12Ollama AI Agent with MCP: Run Local Models in PromptiseRun an AI agent on a local Ollama model with MCP tools: pick a tool-calling model, set the context length, reach a remote Ollama, and fix common errors.Beginner · 11 minOct 18, 2026
  13. 13What Is Human in the Loop AI? Approvals for AI AgentsWhat human in the loop AI means for agents: a person approves risky tool calls before they run. How approval gates work, an example, and common mistakes.Beginner · 7 minOct 18, 2026
  14. 14How to Build an AI Agent in Python (2026 Guide)Build an AI agent in Python step by step: write the tool loop, serve tools over MCP, add model fallback, approvals and limits. Runnable code, real output.Beginner · 20 minOct 18, 2026
  15. 15How to Connect MCP Servers to Your AI Agent in PythonGive your AI agent real tools with the Model Context Protocol. Connect local and remote MCP servers to a Python agent, step by step, with code you can run.Beginner · 12 minOct 11, 2026

Intermediate49

  1. 16AI Agent Evals in CI: Run Them on Every Pull RequestRun AI agent evals in CI on every pull request: test tool choice, arguments, answers and safety, keep cost and flakiness down, with GitHub Actions.Intermediate · 18 minOct 18, 2026
  2. 17AI Agent Cost Tracking: Tokens and Cost per Run and UserTrack AI agent token usage and cost per model call, run, user and agent: price tables, cost ledgers, alerts and limits. Runnable code with real output.Intermediate · 16 minOct 18, 2026
  3. 18AI Agent Production Checklist: What to Check Before LaunchAn AI agent production checklist: security, approvals, guardrails, limits, cost, observability, evals, deployment and incident response, with code.Intermediate · 17 minOct 18, 2026
  4. 19Migrate from AutoGen: Agent Framework, Promptise and MoreAutoGen is archived. Compare migration paths (Microsoft Agent Framework, AG2, Promptise), map agents, group chats and termination, and port an example.Intermediate · 18 minOct 18, 2026
  5. 20CrewAI Alternatives: 7 Options and How to Migrate (2026)CrewAI alternatives compared: why teams look, 7 options and when each fits, a crew rebuilt in Promptise, and a map of crews, agents, tasks and flows.Intermediate · 17 minOct 18, 2026
  6. 21How to Deploy an AI Agent with Docker (2026 Guide)Deploy an AI agent with Docker: a Dockerfile, env config and secrets, health checks, graceful shutdown and docker compose with an MCP server. Tested.Intermediate · 18 minOct 18, 2026
  7. 22LangGraph Alternatives: 7 Options and How to Migrate (2026)LangGraph alternatives compared: why teams look, 7 options and when each fits, the same agent in LangGraph and Promptise, and a concept map to migrate.Intermediate · 18 minOct 18, 2026
  8. 23AI Agent Prompt Injection: How to Defend Against ItHow indirect prompt injection reaches AI agents through tool results, and how to defend: untrusted-data prompts, scanners, approval gates, least privilege.Intermediate · 18 minOct 18, 2026
  9. 24How to Evaluate AI Agents: Evals, LLM Judges and pass^kHow to evaluate AI agents: write golden and refusal tasks, grade tool calls in code, calibrate an LLM judge, measure pass^k and gate CI on the results.Intermediate · 20 minOct 18, 2026
  10. 25AI Agent Stuck in a Loop? How to Detect and Stop ItWhy AI agents get stuck in loops and how to stop them: detect repeated tool calls, cap tool calls per run, and write tool results that end the loop.Intermediate · 18 minOct 18, 2026
  11. 26What Is an Agent Harness? Parts and How to Build OneWhat an agent harness is and how to build one: the tool loop, context compaction, token budgets, loop guards and verification, with runnable code.Intermediate · 18 minOct 18, 2026
  12. 27MCP vs CLI for AI Agents: Tokens, Security, When to Use EachMCP vs CLI tools for AI agents: where the tokens go, prompt caching, per-user security and when to use each or both, with runnable code and real output.Intermediate · 20 minOct 18, 2026
  13. 28AI Agent Reasoning Patterns in Python: 9 Patterns TestedReAct, plan-and-execute, reflection, debate and code-action on the same three tasks, 12 runs each: which agent reasoning patterns were right, at what cost.Intermediate · 15 minOct 15, 2026
  14. 29Build an Authenticated MCP Server for Your AI Agent (Python)An MCP server authentication tutorial in Python: JWT login and roles, an agent that acts for each user, an attack script and a verified audit log.Intermediate · 25 minOct 15, 2026
  15. 30Python AI Agent Frameworks Compared: Which to Choose (2026)Compare Promptise, LangGraph, CrewAI, Pydantic AI, OpenAI Agents SDK, smolagents and LlamaIndex: features, the same agent in each, and which to choose.Intermediate · 22 minOct 18, 2026
  16. 31Durable AI Agents: Crash Recovery and Safe ResumeHow to make an AI agent survive a crash: journal its progress, resume from the last step, and use idempotency keys so side effects never run twice.Intermediate · 16 minOct 18, 2026
  17. 32MCP Security Best Practices: A Checklist for MCP ServersMCP security best practices as a checklist: token audience binding, per-tool scopes, input validation, human approval, rate limits and signed audit logs.Intermediate · 20 minOct 18, 2026
  18. 33AI Agent Cost Control: Budgets That Stop Runaway SpendHow to control AI agent costs: per-run and daily budgets that refuse tool calls before they run, token caps, iteration limits, and what each one misses.Intermediate · 18 minOct 18, 2026
  19. 34AI Agent Audit Logging: Tamper-Evident Logs in PythonLog every AI agent tool call to an HMAC-chained file, then catch edits, deletions and reordering with one command. Real tamper tests, real output.Intermediate · 15 minOct 11, 2026
  20. 35Testing MCP Servers in Python: pytest Without a Live ServerTest an MCP server in Python without running it: auth, guards, middleware, resources, prompts, error envelopes and job queues in 35 pytest tests, plus CI.Intermediate · 16 minOct 11, 2026
  21. 36LLM Tool Rate Limiting: Per-Client Limits for MCP ServersRate limit LLM tool calls per client, tenant and tool on a Python MCP server: a real load test, the error the agent sees, and how to retry it.Intermediate · 14 minOct 11, 2026
  22. 37Context Engineering for AI Agents: Context Window ManagementContext engineering for AI agents in Python: keep what matters in long runs, trim the rest, and cut input tokens 18x. Real token counts per step.Intermediate · 26 minOct 11, 2026
  23. 38Build a Production MCP Server in Python (Step by Step)Build an MCP server in Python ready for real agents: typed tools, clear errors, API keys with roles, rate limits, a tamper-evident audit log and tests.Intermediate · 18 minOct 11, 2026
  24. 39Streaming LLM Responses with FastAPI: Tokens and Tool CallsStream an AI agent's tool calls and answer from FastAPI to a web page with Server-Sent Events, with cancellation, errors and an EventSource page.Intermediate · 14 minOct 11, 2026
  25. 40MCP Transports: stdio vs Streamable HTTP vs SSE (Python)stdio vs Streamable HTTP vs SSE, shown on the wire with curl, then an MCP server over HTTP in production: Host checks, auth, health checks and scaling.Intermediate · 22 minOct 11, 2026
  26. 41FastAPI MCP Server: Turn Your FastAPI App into MCP ToolsTurn your FastAPI app into an MCP server for Claude and AI agents: fix auth, names and descriptions, gate writes, and test it with a real agent.Intermediate · 22 minOct 11, 2026
  27. 42LLM Semantic Cache and Model Fallback in PythonReduce LLM API costs with a semantic cache and survive provider outages with model fallback. Real hits, tokens and a simulated outage, in Python.Intermediate · 23 minOct 11, 2026
  28. 43AI Agent Notifications: Webhook and Slack Alerts in PythonGet alerted when your AI agent fails a tool call, hits a guardrail or budget, or needs approval. Webhooks, Slack and Python callbacks, with real payloads.Intermediate · 25 minOct 11, 2026
  29. 44Deploy AI Agents in Production: Long-Running Python AgentsRun an AI agent as a long-lived Python process: cron and webhook triggers, state between runs, a journal, budgets that pause it, and honest limits.Intermediate · 15 minOct 11, 2026
  30. 45System Prompt Best Practices for AI Agents in PythonBuild agent system prompts from reusable blocks, switch them by conversation phase, and test them like code. Real Python runs, honest limits.Intermediate · 24 minOct 11, 2026
  31. 46AI Agent Guardrails in Python: Block Injection, Redact PIIAdd guardrails to an AI agent in Python: block prompt injection, redact PII and leaked API keys, add custom rules, and test it all. Real runs, real misses.Intermediate · 19 minOct 11, 2026
  32. 47AI Agent Memory in Python: Short-Term and Long-TermGive your AI agent memory that lasts: chat history per session, long-term facts across sessions, kept per user. Python code with real output.Intermediate · 18 minOct 11, 2026
  33. 48Self-Improving AI Agent: Learn From Tool Failures in PythonBuild an AI agent that learns from failed tool calls without fine-tuning. Real before-and-after numbers, plus the risks: bad lessons, leaks, poisoning.Intermediate · 22 minOct 11, 2026
  34. 49How to Test LLM Prompts and AI Agents in PythonUnit test LLM prompts with pytest, catch prompt regressions in CI, grade outputs with an LLM judge and evaluate agent tool calls. Real runs, real costs.Intermediate · 24 minOct 11, 2026
  35. 50Build a Multi-Agent System in Python (and When Not To)Build a coordinator that delegates to specialist AI agents in Python, trace every call, and see what a multi-agent system really costs.Intermediate · 24 minOct 11, 2026
  36. 51MCP Server Caching, Timeouts and Circuit Breakers in PythonKeep an MCP server fast when its API is flaky: caching, retries with backoff, timeouts, a circuit breaker and limits, with real before and after numbers.Intermediate · 23 minOct 11, 2026
  37. 52Event-Driven AI Agents: Webhook, Cron and File TriggersRun an AI agent on a GitHub webhook, a cron schedule or a new file, with signed webhooks and real prompt-injection tests. Python code that runs.Intermediate · 22 minOct 11, 2026
  38. 53MCP Long-Running Tasks: Background Jobs in PythonRun slow MCP tools as background jobs in Python: submit, poll progress, retry failures and cancel, with a real agent, real runs and honest limits.Intermediate · 19 minOct 11, 2026
  39. 54Too Many MCP Tools? LLM Tool Selection, MeasuredWhat 122 tools do to an LLM agent's accuracy, tokens and latency, measured, and how semantic tool selection fixes it in Python, with honest limits.Intermediate · 18 minOct 11, 2026
  40. 55AI Agent Observability: Trace Tool Calls, Tokens and CostTrace every LLM call and tool call your AI agent makes, with tokens, latency and cost, then use the trace to find the exact step that went wrong.Intermediate · 18 minOct 11, 2026
  41. 56AI Agent YAML: Define and Run an Agent From a Config FileDefine an AI agent in a YAML file: model, instructions and MCP servers. Validate it, run it from the CLI or Python, keep secrets out, review it in Git.Intermediate · 18 minOct 11, 2026
  42. 57Best LLM for AI Agents: Test and Switch Models in PythonFind the best LLM for your AI agent with a tool-calling eval, then switch between OpenAI, Anthropic, Azure, Bedrock, Gemini and Ollama in one line.Intermediate · 22 minOct 11, 2026
  43. 58MCP Server Monitoring: Prometheus, OpenTelemetry and LogsMonitor an MCP server in Python: Prometheus metrics, JSON logs, OpenTelemetry traces and alerts that show which tools are slow, failing or abused.Intermediate · 20 minOct 11, 2026
  44. 59Approval Fatigue: Auto-Approve Safe AI Agent ActionsStop rubber-stamping AI agent actions. Auto-approve routine tool calls with rules, send only risky ones to a human, and log why. Real Python runs.Intermediate · 21 minOct 11, 2026
  45. 60OpenAPI to MCP: Turn Any REST API into an MCP ServerTurn an OpenAPI spec into a working MCP server in minutes. Read-only by default, human approval on every write, and tested by a real agent.Intermediate · 15 minOct 11, 2026
  46. 61AI Agent Human in the Loop: Approve Tool Calls in PythonMake your AI agent ask a human before it refunds, emails or deletes. Approve or reject tool calls in Python, with real runs and honest limits.Intermediate · 20 minOct 11, 2026
  47. 62Agentic RAG in Python: Give Your AI Agent a Search ToolBuild a RAG AI agent in Python: index your docs, give the agent a search tool, cite sources, and make it say "I don't know". Real code, real output.Intermediate · 21 minOct 11, 2026
  48. 63AI Agent Code Execution Sandbox: Run LLM Code SafelyLet an AI agent write and run Python in a Docker sandbox: analyse a CSV, try real escape attempts, set limits, and learn where the sandbox stops.Intermediate · 18 minOct 11, 2026
  49. 64MCP Tools vs Resources vs Prompts (With Python Examples)When to use an MCP tool, resource or prompt, and how to build each in Python: resource templates, prompt arguments, tests and feeding them to an agent.Intermediate · 20 minOct 11, 2026

Advanced7

  1. 65Code-Action Agents in Python: One Program vs 37 Tool CallsBuild a code-action agent in Python over an MCP server, test it against ReAct in 60 runs, and see why a tool budget set too low returns wrong answers.Advanced · 15 minOct 15, 2026
  2. 66Autonomous AI Agent Runtime: Budgets, Crash Recovery, APIRun an autonomous AI agent runtime in Python: budgets for irreversible actions, restarts, kill -9 recovery, missions and an API, tested on real runs.Advanced · 18 minOct 11, 2026
  3. 67Self-Modifying AI Agent in Python: Open Mode & LimitsBuild a self-modifying AI agent in Python with Promptise open mode: meta-tools, hot reload, the guardrails that bound it, and honest measured limits.Advanced · 16 minOct 11, 2026
  4. 68MCP Authentication in Python: API Keys, JWT and OAuthMCP authentication in Python on one server: API keys, JWTs and OAuth client credentials with JWKS, plus roles, scopes, 401s and agent token forwarding.Advanced · 20 minOct 11, 2026
  5. 69AI Agent Identity: Authenticate Agents to MCP ServersGive your AI agent its own verifiable identity: short-lived JWTs from your IdP, checked by MCP servers with JWKS. Real runs, refresh and honest limits.Advanced · 22 minOct 11, 2026
  6. 70Plan-and-Execute Agents in Python: Beyond the ReAct LoopBuild a plan, act, verify, reflect agent in Python with the Promptise Reasoning Graph, then compare it with ReAct on one task: accuracy, calls, tokens.Advanced · 15 minOct 11, 2026
  7. 71Multi-Tenant AI Agents: Keep Each Customer's Data ApartBuild a multi-tenant AI agent in Python: per-user tokens, tenant-scoped MCP tools and isolated sessions, with runs proving one tenant can't read another.Advanced · 18 minOct 11, 2026
[n.02/02]> go further

Topics in this category

  • Model Context Protocol (MCP)36
  • Tool Calling11
  • Evals and Testing8
  • Agent Runtime7
  • Cost Control7
  • Observability7
  • Authentication and Access Control6
  • Human-in-the-Loop6
  • AI Agent Frameworks5
  • Guardrails5

Topic hubs

  • Tools and the Model Context Protocol (MCP)→
  • Runtime, triggers and deployment→
  • Guardrails and security→
  • Cost control and rate limits→
  • Testing and evals→
  • Building AI agents in Python→

Other categories

  • Prompt Engineering54
  • LLM Security10

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths