Skip to main content

CLI-first memory engine for LLM applications.

Project description

Contexara

Memory engine for LLM applications. Drop it into any AI system and it remembers what matters — across sessions, without a vector database, without infra.

pip install contexara
contexara setup   # configure AWS Bedrock credentials

How it works

Three tiers of memory, always in sync:

Tier What it stores Lifecycle
1 — Raw turns Every message in the active session Lives until session closes
2 — Episodes LLM-crystallized session summaries Created on session close (background)
3 — Semantic facts Extracted atomic memories Permanent, compressed when over budget

Every ask pulls from all three tiers — recent turns for continuity, episode summary for session handoff, semantic memories for persistent facts.

Sessions close after 60 minutes of inactivity. A background worker crystallizes them into structured summaries (title, actions, outcomes, open items) without blocking the user.

Cold archive: raw turns older than 30 days sweep automatically to a SQLite FTS5 store — full-text searchable across years of history.


CLI

contexara ask "what was I working on?"
contexara store "prefers Python"
contexara ingest notes.md               # bulk ingest .txt / .md / .jsonl
contexara list
contexara list --since 2026-04-01
contexara search "tech stack"
contexara show <id>
contexara delete <id>
contexara stats
contexara consolidate                   # LLM-compress overlapping memories
contexara prune                         # archive expired (TTL) memories
contexara chat                          # interactive chat mode

Namespaces

Isolate memory per agent, project, or user:

contexara namespace create coding_agent
contexara namespace list
contexara namespace remove coding_agent

contexara ask "what am I building?" --namespace coding_agent
contexara chat --namespace coding_agent

MCP server

Expose Contexara as an MCP tool server — lets AI agents manage their own memory autonomously:

contexara mcp                          # stdio (Claude Desktop, agent SDKs)
contexara mcp --sse --port 8000        # SSE for HTTP agents

13 tools available: chat_ingest, chat_context, memory_store, memory_search, memory_list, memory_forget, memory_deprecate, memory_stats, episodes_search, episodes_latest, session_checkpoint, archive_search, namespace_list.


Python SDK

from contexara import ContexaraClient

client = ContexaraClient(namespace="coding_agent")

# Before responding — load context
memories = client.memory.search("user's current goal")
recent = client.chat.get_recent_turns(n=10)
episodes = client.episodes.search("what did I work on last week?")

# After responding — save the turn
client.chat.ingest(user_message, assistant_response)

# When you learn something worth remembering
client.memory.store("user prefers typed Python", kind="preference", importance=3)

# When a major task finishes
client.episodes.crystallize()

All write operations have async equivalents (astore, aingest, acrystallize, etc.).


Stack

Layer Technology
Storage SQLite — raw turns, episodes, memories, cold archive (FTS5)
Embeddings Amazon Titan Text Embeddings V2 via Bedrock
LLM AWS Bedrock — extraction, crystallization, Q&A
Retrieval RRF hybrid search + temporal weighting
Transports CLI · Python SDK · MCP (stdio + SSE)

Built by Prajwal Narayan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contexara-1.0.0.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contexara-1.0.0-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

Details for the file contexara-1.0.0.tar.gz.

File metadata

  • Download URL: contexara-1.0.0.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for contexara-1.0.0.tar.gz
Algorithm Hash digest
SHA256 534b09b1ef5293842ce58699485bf93d31c00f36612f776f343129e2a06aa39e
MD5 3294d3715cbe21f74df58f30b9cffc00
BLAKE2b-256 ca86440317bb4ab517ca14303d49e40de4191f184b3b23c3d469cdd2bfa5e2ba

See more details on using hashes here.

File details

Details for the file contexara-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: contexara-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for contexara-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73767b10e779c314b808013d5949d420a90bd1f8046f531c782b9b81a07f886b
MD5 64eb0ce8b1da570901bfa0438acdb1bf
BLAKE2b-256 107b0c0e9a90f66d3b7b874cb517664d02adde785e2e333debef407520dc1bd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page