Skip to main content
Connic

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 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

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.

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. Each job is visible in the dashboard.

Scored results

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.

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

Use 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

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.

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.

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. 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.

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. They support automated ingestion pipelines and content sync from external systems.

Dashboard management

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.

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 visible in the dashboard. For production agents, a purpose-specific custom tool wraps retrieval_query, fixes the namespace and search parameters, and 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.

Set session: true for one shared session across the agent’s runs, or set session.key to a context.* or input.* path for separate sessions. History and browser persistence both default to true and can be disabled independently. False, null, or omitting session disables persistence. Optional ttl expires inactive sessions; manage them under Storage > Sessions.

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. The database suits orders, users, and events; Retrieval suits 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 its custom fields.

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