Skip to main content
Connic

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 docs

Retrieval

24 entries · 3 namespaces
Search…
SourceEntry IDNamespace
  • invoice-template.pdf
    inv_a1b2c3
    policies.finance
  • tax-rules-2026.md
    tax_d4e5f6
    policies.finance
  • refund-faq.txt
    faq_g7h8i9
    support.faq
  • product-catalog.png
    cat_j0k1l2
    products
  • shipping-policy.md
    shp_m3n4o5
    support.shipping
  • vendor-contract.pdf
    vnd_p6q7r8
    policies.legal
Retrieval

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.

tools/support_policy.py
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
SourceNamespace
  • refund-faq.txt· 27 chunks
    support.faq
  • shipping-policy.md· 12 chunks
    support.faq
  • tax-rules-2026.md· 42 chunks
    policies.finance
  • vendor-contract.pdf· 31 chunks
    policies.legal
  • product-shot.png· 8 chunks
    products
Many formats

Text, markdown, CSV, JSON, YAML, logs, PDF, images.

Async ingestion

Files are queued, chunked, and embedded in the background. Track each job in the dashboard.

Scored results

Returns content, entry ID, namespace, and a relevance score. Read the retrieval docs

Sessions

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.

agents/support-bot.yaml
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 inactivity

key 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

user
I want a refund for order ORD-184.
user: refund for ORD-184
assistant: Looked it up, refund issued.

Conversation history kept across runs. TTL configurable.

user
When will it arrive?
# Agent already knows the order context.
Database

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.

tools/save_invoice.py
# 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
tools/list_invoices.py
# 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"]
Auto-created collections

No schema setup. The first db_insert creates the collection. Each document gets _id, _created_at, and _updated_at automatically.

Expressive filters

$eq, $ne, $gt/$gte/$lt/$lte, $in/$nin, $and/$or/$not, $exists, $contains, $elemMatch, $regex. Sort, paginate, project, or list distinct values.

Seven predefined tools

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

Environment-scoped isolation

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.

Scoped API keys

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.

Dashboard management

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.

Frequently Asked Questions

Plain text and markdown (.txt, .md, .markdown), CSV, JSON / JSONL, YAML, log files, PDFs, and images (.png, .jpg, .jpeg, .gif, .webp). Text formats are chunked and embedded; PDFs are extracted with page numbers preserved; images go through vision extraction before being embedded.

Uploads are accepted immediately and indexed asynchronously as ingestion jobs you can monitor in the dashboard. For production agents, wrap retrieval_query in a purpose-specific custom tool that fixes the namespace and search parameters, then returns only the passage and citation fields the agent needs. Agent YAML can enforce read-only access to the allowed namespaces.

Namespaces are dot-separated paths (e.g. policies.hr.leave) up to 10 levels deep. Querying a parent namespace also searches all sub-namespaces. Entry IDs are unique within a namespace, and agents can discover the hierarchy at runtime with the retrieval_list_namespaces tool.

Sessions let an LLM agent keep conversation history across requests. Enable them in the agent YAML by setting a session.key (resolved from middleware context.* or input.*) and an optional ttl in seconds (minimum 60). Without a session block, every request starts fresh. Active sessions are managed under Storage > Sessions in the dashboard.

The database stores structured documents in named collections and is queried by exact field values using filter operators ($eq, $gt, $in, $and, etc.). Retrieval indexes unstructured content and finds passages by meaning. Use the database for orders, users, and events; use Retrieval for FAQs, documentation, and notes.

No. Documents are free-form and collections are auto-created the first time db_insert runs. Each document automatically gets _id (a UUID), _created_at, and _updated_at system fields alongside whatever fields you write.

Retrieval, sessions, and the database are all scoped per environment. Production and staging in the same project keep separate data.