Portable binary graph memory for AI agents
Project description
AgenticMemory Python SDK (v0.2.0)
Python SDK for AgenticMemory -- portable binary graph memory for AI agents. 16 query types, zero dependencies.
Install
pip install agentic-brain
With LLM integrations
pip install agentic-brain[anthropic] # Claude
pip install agentic-brain[openai] # GPT
pip install agentic-brain[ollama] # Local models
pip install agentic-brain[all] # All providers
Quick Start
from agentic_memory import Brain
brain = Brain("my_agent.amem")
brain.add_fact("User is a Python developer", session=1)
brain.add_decision("Recommended FastAPI for REST APIs", session=1)
print(brain.facts())
print(brain.info())
v0.2 Query Expansion
Nine new methods added in v0.2.0:
brain = Brain("my_agent.amem")
# Retrieval
results = brain.search_text("API rate limit") # BM25 (1.58 ms @ 100K)
results = brain.search("caching strategy", top_k=10) # Hybrid BM25+vector (10.83 ms)
# Structural analysis
scores = brain.centrality(metric="pagerank") # PageRank (34.3 ms @ 100K)
path = brain.shortest_path(src=42, dst=99) # BFS (104 us @ 100K)
# Cognitive reasoning
report = brain.revise(node_id=42) # Counterfactual cascade (53.4 ms)
gaps = brain.gaps() # Find reasoning weaknesses
matches = brain.analogy(node_id=42, top_k=5) # Structural pattern matching
# Graph maintenance
report = brain.consolidate(dry_run=True) # Dedup, contradiction linking
drift = brain.drift() # Belief evolution tracking (68.4 ms)
With LLM Integration
from agentic_memory import Brain, MemoryAgent
from agentic_memory.integrations import AnthropicProvider
brain = Brain("my_agent.amem")
agent = MemoryAgent(brain, AnthropicProvider())
response = agent.chat("My name is Alice. I work on ML systems.", session=1)
response = agent.chat("What do I work on?", session=2)
Test Coverage
104 tests across 8 modules, including 20 tests for the v0.2 query expansion methods.
Requirements
- Python >= 3.10
amembinary (Rust core engine) -- install viacargo install agentic-memory
Documentation
License
MIT
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
agentic_brain-0.2.1.tar.gz
(38.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentic_brain-0.2.1.tar.gz.
File metadata
- Download URL: agentic_brain-0.2.1.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14f7af0c2de330af6cf9ba3a62b14dd3b0fe3946b6b6ef2fe1913a61282fb014
|
|
| MD5 |
5e320f0ef98792d073e682a9c56fbb29
|
|
| BLAKE2b-256 |
45769f08685ac7ced04c663d120bcf0f96a137f6227f1ff94b8532475e3a6e79
|
File details
Details for the file agentic_brain-0.2.1-py3-none-any.whl.
File metadata
- Download URL: agentic_brain-0.2.1-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36290cae7d029acf17aad022ce2854b257a01b5170706e66ba176de905962045
|
|
| MD5 |
a8696e018bf45d8198dd67fa01ebb9a4
|
|
| BLAKE2b-256 |
dc1cf40abad4ec2c0b39305c04da6dd7218df959378a68ba5c2583f70c79529a
|