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, persistentsqlite(no path) — alias forsqlite::memory:(ephemeral)chroma— ephemeral Chroma clientchroma:<path>— persistent Chroma at<path>postgres://<dsn>/postgresql://<dsn>— Postgres+pgvectorredis://<dsn>/rediss://<dsn>— Redis (with optional RediSearch vector index)
Recognised dict keys:
backend(required) — same scheme set as abovepath/url/dsn— backend-specific connection targetnamespace— partition / collection / key-prefix (consistent name across backends; each backend maps it to its native kwarg)embedder—"openai"/"hash"/ explicitEmbedderinstance.Nonetriggers auto-pick (OpenAI ifOPENAI_API_KEYset, else Hash)with_facts— defaultTruefor the resolver path; passFalseto skip the fact-store wiringcollection_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 a |
Module Contents¶
- jeevesagent.memory.resolver.resolve_memory(spec: Any) jeevesagent.core.protocols.Memory[source]¶
Resolve a
memory=argument into a concreteMemory.Nonereturns the default in-memory backend; a string parses by URL scheme; a dict parses bybackendkey; anything else is assumed to already be aMemoryand passed through unchanged.