jeevesagent.memory.resolver

String / dict resolver for the memory= Agent kwarg.

Mirrors the design of jeevesagent.agent.api._resolve_model(): the user passes a string (”sqlite:./bot.db”) or a dict ({“backend”: “chroma”, “path”: “./mem”, …}) and the framework returns a fully-constructed Memory (or a LazyMemory proxy for async-connect backends).

Recognised string schemes:

  • inmemory — in-process dict, lost on restart (the default)

  • sqlite:<path> — single-file SQLite, persistent

  • sqlite (no path) — alias for sqlite::memory: (ephemeral)

  • chroma — ephemeral Chroma client

  • chroma:<path> — persistent Chroma at <path>

  • postgres://<dsn> / postgresql://<dsn> — Postgres+pgvector

  • redis://<dsn> / rediss://<dsn> — Redis (with optional RediSearch vector index)

Recognised dict keys:

  • backend (required) — same scheme set as above

  • path / url / dsn — backend-specific connection target

  • namespace — partition / collection / key-prefix (consistent name across backends; each backend maps it to its native kwarg)

  • embedder"openai" / "hash" / explicit Embedder instance. None triggers auto-pick (OpenAI if OPENAI_API_KEY set, else Hash)

  • with_facts — default True for the resolver path; pass False to skip the fact-store wiring

  • collection_name (Chroma), key_prefix (Redis), etc. — any backend-native kwarg passes through unchanged

The resolver is non-async even when the underlying backend needs an async connect. Postgres / Redis URLs return a LazyMemory proxy that opens the connection on first use, so the Agent.__init__ call site stays synchronous.

Functions

resolve_memory(→ jeevesagent.core.protocols.Memory)

Resolve a memory= argument into a concrete Memory.

Module Contents

jeevesagent.memory.resolver.resolve_memory(spec: Any) jeevesagent.core.protocols.Memory[source]

Resolve a memory= argument into a concrete Memory.

None returns the default in-memory backend; a string parses by URL scheme; a dict parses by backend key; anything else is assumed to already be a Memory and passed through unchanged.