Ship AI agents your business can actually rely on.
Most agent projects stall between the demo and production: they leak data, run up the token bill, break when a provider goes down, and nobody can say what they did. The Promptise Agent comes with guardrails, memory, cost controls, failover and full traces built in, so your team ships the agent instead of the infrastructure around it.
Skip the months of plumbing between demo and production.
A demo needs a model and a loop. Production needs memory, safety, caching, approvals, tracing and failover. Here each one is a single argument, so your team builds the product, not the platform.
Build it all yourself
Wire tool schemas by hand. Build a memory layer. Write guardrails from scratch. Glue together caching, streaming and observability.
Configure what you need
Point at MCP servers and the tools appear. Add memory= and context is injected every turn. Add guardrails=True and injection attempts are scanned before they reach the model.
What ships with it
MCP tool discovery, three memory providers, a semantic cache, six guardrail detectors, human approval, streaming, model fallback, adaptive learning, a Docker sandbox and observability exporters.
Every request follows the same governed path.
Every request passes through four phases. Each capability only activates when it is configured, so what you do not enable costs nothing.
Input
- Message received
- Session resolution
- Security scan
Context
- Context assembly
- Memory retrieval
- Semantic cache
- Tool discovery
Execution
- LLM reasoning
- Tool calling
- Human approval
- Sandbox
- Model failover
Output
- Stream response
- Trace capture
- Learn and adapt
Connect any tool, and pay only for the tokens that matter.
Point the agent at your tool servers and it reads each tool’s schema: no hand-written definitions, no adapter code. Two optimizations then keep the token bill down as your tool catalogue grows.
Discovery, not definitions
The agent connects, reads what each tool does, what parameters it takes and what it returns, and starts using it correctly. When a tool changes on the server, the next connection picks up the new version.
- Nested objects, arrays, enums and unions are handled
- One server or twenty at the same time
- The agent’s capabilities grow with your infrastructure
servers={ "crm": HTTPServerSpec( url="https://crm.internal/mcp", bearer_token="...", ), "analytics": HTTPServerSpec( url="https://analytics.internal/mcp", ), "email": HTTPServerSpec( url="https://email.internal/mcp", transport="sse", ),} # tools are discovered from each server's schemas# add or remove a server and the tool set followsSemantic tool selection
An agent with forty tools would send all forty descriptions on every message. Selection matches the user’s intent against tool capabilities with local embeddings and sends only the relevant ones. The docs estimate roughly 40% savings for static optimization and more with full semantic selection.
optimize_tools="semantic"Semantic cache
“What’s my balance?” and “Show my balance” mean the same thing. The cache matches new queries against earlier ones with the same local embedding model and returns the stored answer above a similarity threshold. The docs estimate 30-50% lower API cost where queries repeat.
cache=SemanticCache(similarity_threshold=0.92)from promptise import SemanticCache agent = await build_agent( ..., optimize_tools="semantic", # send only relevant tools cache=SemanticCache( similarity_threshold=0.92, ),)It remembers your customers, and keeps a record of everything it did.
Long-term memory, persistent conversations and full observability, so answers improve with context and every decision can be traced. Pick one to see how it works.
It remembers, without being told to look.
Without memory every conversation starts from zero. Promptise searches memory for relevant context and injects it before each invocation, with no explicit retrieval call in your code. Switching providers is one parameter.
- ChromaProvider: local vector search with persistent storage
- Mem0Provider: hybrid vector and graph search
- InMemoryProvider: fast, for tests and development
- Memory can be scoped per user
Protect your users, your data and your brand.
Guardrails scan what goes in and out, the sandbox contains what the agent runs, and approval keeps a person in charge of the actions that matter.
Six detectors on every message.
Detectors scan input and output locally, with no external API calls for scanning. You pick the ones you need.
- Injection: a local DeBERTa model scores injection and jailbreak attempts
- PII: 69 patterns, including cards, IDs from 22+ countries, emails and phones
- Credentials: 96 patterns across 60+ services, plus keys and connection strings
- Names and addresses: GLiNER named-entity recognition
- Content safety: Llama Guard locally, or Azure AI Content Safety
- Custom rules: any pattern you define
Fast for your users, resilient when providers fail.
Streaming so nobody stares at a spinner, failover when a provider goes down, and adaptive learning so the same mistake is not made twice.
Responses that appear in real time.
When an agent takes ten seconds, users assume the app is broken. Streaming shows what is happening: which tool started, what it found, then the answer arriving token by token. Guardrails redact sensitive arguments so they never appear in the stream.
- tool_start: with a readable display name
- tool_end: with a summary and duration
- tokens, completion and error events
Never get locked into one model provider.
Switch models as prices and quality change. Your instructions, tools, memory and guardrails stay exactly the same, so nothing needs rewriting.
Configured in code
A string is enough for the common case. When a provider needs more, such as an endpoint, an API version, a region or a deployment name, Model(...) takes it as an argument. Keys are read from a .env beside your script when you do not pass them, and never appear in a repr, a log or an error.
Check before you spend
Every provider is in one registry, so the framework can tell you what a model string needs before the first request costs anything.
from promptise import Model, build_agent # the common case: a stringagent = await build_agent(model="openai:gpt-5-mini", servers={}) # everything a provider can need, in one placeagent = await build_agent( model=Model( "gpt-4o", provider="azure", endpoint="https://acme.openai.azure.com/", api_version="2024-10-21", deployment="chat-prod", ), servers={},) # self-hosted works the same wayModel("llama3.1", provider="ollama", endpoint="gpu-box:11434")promptise models list
Every provider, its aliases and what it needs.
clipromptise models check openai:gpt-5-mini
Whether this string is usable right now, and if not, why.
clipromptise models env azure
The exact .env template for that provider.
cliWhen something breaks, the agent degrades, not your service.
Something will break in production. What matters is what the agent does next.
The provider goes down
The fallback chain switches to the next model, and a circuit breaker prevents retry storms.
fallbackThe token budget is exceeded
BudgetHook stops the graph, and the ExecutionReport records what was accomplished.
budgetThe agent loops
CycleDetectionHook detects a repeating pattern and ends the graph.
cyclesA tool crashes
The RETRYABLE flag retries with backoff, and CRITICAL aborts if the step is essential.
flagsA user sends an injection
The injection detector scores it before it reaches the model, and the event is logged.
guardrailsThe output contains PII
Output scanning checks each response, and matches are redacted before they reach the user.
scanningBuild production agents, not prototypes.
Open source under Apache 2.0. Install it, build something, ship it.