Python
Install the Python SDK and run the reference CLI.
Install
pip install jeffs-brain-memory uv add jeffs-brain-memory Requires Python >=3.11.
CLI quick start
memory init ./my-brain
memory ingest ./docs/hedgehogs.md --brain ./my-brain
memory search "where do hedgehogs live?" --brain ./my-brain
memory serve --addr 127.0.0.1:18842
memory ask --brain default --question "what did we decide?"
memory remember --brain default --path memory/notes.md --content "..."
memory recall --brain default --query "auth decision"
memory reflect --brain default
memory consolidate --brain default
memory create-brain --brain eval
memory list-brains
Same subcommands as the TypeScript and Go CLIs. See the CLI reference.
Environment variables
| Variable | Purpose |
|---|---|
JB_HOME | Storage root (default ~/.jeffs-brain/). |
JB_TOKEN | Hosted bearer token. When set the SDK drives the platform HttpStore. |
JB_ENDPOINT | Hosted endpoint URL when JB_TOKEN is set. |
JB_LLM_PROVIDER | openai, anthropic, ollama, or fake. |
JB_LLM_MODEL | Model id for the chosen provider. |
OLLAMA_HOST | Default http://localhost:11434. |
Programmatic use
The Python SDK mirrors the TypeScript reference surface: store, query, search, retrieval, memory, knowledge, llm, rerank, ingest, and http are all exposed under jeffs_brain_memory.
from pathlib import Path
from jeffs_brain_memory.store.fs import FsStore
from jeffs_brain_memory.knowledge import Knowledge
from jeffs_brain_memory.search import SearchIndex
brain_id = "hello-world"
root = Path("./data") / brain_id
root.mkdir(parents=True, exist_ok=True)
store = FsStore(root=root)
index = SearchIndex(db_path=root / "search.db")
knowledge = Knowledge(brain_id=brain_id, store=store, index=index)
knowledge.ingest(path=Path("./docs/hedgehogs.md"))
hits = knowledge.search(query="where do hedgehogs live?", max_results=3)
for i, hit in enumerate(hits, start=1):
print(f"{i}. [{hit.score:.3f}] {hit.path}\n {hit.snippet}")
For the full feature list see the Python SDK README.