Retrieval, sessions,
and a database, built in
Use managed retrieval for documents, sessions for conversation history, and the document database for structured records. Each service is scoped to an 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
Managed semantic retrieval
Connic chunks, embeds, and namespaces uploaded text, data files, PDFs, and images. Expose a narrow search tool with fixed scope and a stable citation shape.
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. Track each job in the dashboard.
Returns content, entry ID, namespace, and a relevance score. Read the retrieval docs
Multi-turn conversations that survive restarts
Add a session block to an LLM agent and Connic keeps conversation history across requests, keyed by anything you derive from middleware context or the inbound payload.
name: support-bot
type: llm
model: connic/gpt-5.6-terra
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 inactivitykey is a dot-path that must start with context. (set in before middleware) or input. (read from the raw payload). Optional ttl in seconds (minimum 60); without it sessions never expire. Without a session block, every request starts fresh. 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.
Schemaless collections, no migrations
Every environment includes a managed document database. Collections are created the first time an agent inserts. Query with expressive filter operators.
# 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. Browse data and inferred schemas under Storage → Database in the dashboard. See docs
Storage controls built into every project
Environment-scoped isolation, scoped API keys, and a dashboard to inspect everything
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. Use them to automate ingestion pipelines or sync content from external systems.
Inspect every primitive from one place: Retrieval tracks ingestion jobs and namespaces, Storage > Sessions lists and clears active sessions, and Storage > Database browses collections, documents, and inferred schemas.