Get MemLens up and running in under 5 minutes.
- Python 3.9+
- pip
pip install memlenspython -m memlens.api.mainThe server will start at http://localhost:8000.
curl http://localhost:8000/healthYou should see:
{"status": "healthy", "version": "0.1.0"}Create a file first_trace.py:
import asyncio
from memlens.sdk import MemLensClient
from memlens.core.models import MemoryCandidate, MemoryType
async def main():
client = MemLensClient("http://localhost:8000")
# Create a write trace
trace = await client.create_write_trace({
"session_id": "session_123",
"user_id": "user_456",
"agent_id": "agent_1",
"raw_input": "User prefers dark mode",
"candidates": [
{
"content": "User prefers dark mode",
"importance_score": 0.92,
"memory_type": "pattern",
}
],
"stored_memories": [
{
"content": "User prefers dark mode",
"importance_score": 0.92,
"memory_type": "pattern",
}
],
"dropped_memories": [],
"extraction_metadata": {"model": "gpt-4"},
})
print(f"Trace created: {trace['trace_id']}")
asyncio.run(main())Run it:
python first_trace.py- Integration Guide — Integrate with your agent
- API Reference — Explore the API
- Architecture Guide — Understand the internals