Store data for AI agents
without separate infrastructure
Use retrieval, sessions, and the database directly in Connic. Your agents can search documents, continue conversations, and manage structured data. Data stays separate for each environment.
Read the retrieval docsRetrieval
24 entries · 3 namespaces- invoice-template.pdfinv_a1b2c3policies.finance
- tax-rules-2026.mdtax_d4e5f6policies.finance
- refund-faq.txtfaq_g7h8i9support.faq
- product-catalog.pngcat_j0k1l2products
- shipping-policy.mdshp_m3n4o5support.shipping
- vendor-contract.pdfvnd_p6q7r8policies.legal
Add knowledge from documents to agent responses
Give your AI agents access to text, PDFs, and images for search. Connic handles content processing. Define in code which content the search tool can search; it returns relevant passages with source references.
from connic.tools import retrieval_query
async def search_support_policy(question: str) -> list[dict]:
"""Find approved policy passages for a support question."""
result = await retrieval_query(
query=question,
namespace="support.approved",
min_score=0.35,
max_results=5,
)
matches = []
for item in result["results"]:
citation = {"entry_id": item["entry_id"]}
if item.get("page_number") is not None:
citation["page_number"] = item["page_number"]
matches.append({
"passage": item["content"],
"citation": citation,
})
return matches- refund-faq.txt· 27 chunkssupport.faq
- shipping-policy.md· 12 chunkssupport.faq
- tax-rules-2026.md· 42 chunkspolicies.finance
- vendor-contract.pdf· 31 chunkspolicies.legal
- product-shot.png· 8 chunksproducts
Text, markdown, CSV, JSON, YAML, logs, PDF, images.
Files are queued, chunked, and embedded in the background. Each job is visible in the dashboard.
Returns content, entry ID, namespace, and a relevance score. Read the retrieval docs
Give AI agents access to conversation context
Let Connic store earlier messages for subsequent requests, even after a restart. Use one shared session per agent or separate conversations with a key from middleware or input data.
name: support-bot
type: llm
model: connic/gpt-5.6-sol
system_prompt: |
You are a helpful support agent.
Use the conversation history for context.
# Persist conversation history per chat
session:
key: context.chat_id
ttl: 86400 # expire after 24h of inactivityUse session: true for one shared session across the agent’s runs. The optional key separates sessions using context. (set in before middleware) or input. (read from the raw payload). history and browser both default to true. Optional ttl is in seconds (minimum 60); without it sessions do not expire. See docs
I want a refund for order ORD-184.
Conversation history kept across runs. TTL configurable.
When will it arrive? # Agent already knows the order context.
Use a database for AI agents. Already set up.
Use a separate database in each Connic environment. Let your agents store data and query it with filters. Collections are created on the first write, with no fixed schema to define.
# No setup needed - the collection "invoices" is created
# automatically the first time db_insert runs.
result = await db_insert("invoices", {
"vendor": "Acme Corp",
"total": 4920,
"currency": "EUR",
"processed_at": "2026-04-12T10:30:00Z",
"raw_event": {"id": "evt_123", "type": "invoice.paid"},
})
# result["inserted"][0]["_id"] -> auto-generated UUID# Query with filter operators - no SQL, no migrations
result = await db_find(
"invoices",
filter={
"vendor": "Acme Corp",
"processed_at": {"$gt": "2026-04-01"},
},
sort={"processed_at": -1},
limit=20,
)
documents = result["documents"]No schema setup. The first db_insert creates the collection. Each document gets _id, _created_at and _updated_at automatically.
$eq, $ne, $gt/$gte/$lt/$lte, $in/$nin, $and/$or/$not, $exists, $contains, $elemMatch, $regex. Sort, paginate, project, or list distinct values.
db_find, db_insert, db_update, db_upsert, db_delete, db_count, db_list_collections. Data and inferred schemas are available under Storage → Database in the dashboard. See docs
Separate data. Restrict access. Inspect content.
Keep data separate by environment and define scoped permissions with API keys. Use the dashboard to keep an overview.
Retrieval entries, persistent sessions, and database collections are all scoped per environment. Production and staging in the same project keep their data separate by default.
REST API keys can be granted granular permissions, including retrieval read and write scopes. They support automated ingestion pipelines and content sync from external systems.
Every primitive is visible in one place: Retrieval tracks ingestion jobs and namespaces, Storage > Sessions lists and clears active sessions, and Storage > Database browses collections, documents, and inferred schemas.