|
9 | 9 | - First-class multi-agent support (cross-agent queries, structured handoffs, scoped ACLs) |
10 | 10 | - Production-oriented design (FastAPI + Postgres + pgvector) |
11 | 11 |
|
12 | | -Quick Start (Manual Control): |
| 12 | +Quick Start (Local Mode - Zero Config): |
| 13 | + from aegis_memory import local_client |
| 14 | +
|
| 15 | + client = local_client() |
| 16 | + client.add("User prefers dark mode", agent_id="ui-agent") |
| 17 | + memories = client.query("user preferences", agent_id="ui-agent") |
| 18 | +
|
| 19 | +Quick Start (Remote Server): |
13 | 20 | from aegis_memory import AegisClient |
14 | | - |
| 21 | +
|
15 | 22 | client = AegisClient(api_key="your-key", base_url="http://localhost:8000") |
16 | | - |
| 23 | +
|
17 | 24 | # Add a memory |
18 | 25 | result = client.add("User prefers dark mode", agent_id="ui-agent") |
19 | | - |
20 | | - # Query memories |
| 26 | +
|
| 27 | + # Query memories |
21 | 28 | memories = client.query("user preferences", agent_id="ui-agent") |
22 | 29 |
|
23 | 30 | Quick Start (Smart Memory - Zero Config): |
|
54 | 61 | For more examples, see: https://github.com/quantifylabs/aegis-memory/tree/main/examples |
55 | 62 | """ |
56 | 63 |
|
57 | | -__version__ = "2.1.0" |
| 64 | +__version__ = "2.2.0" |
58 | 65 |
|
59 | 66 | # Core client (manual control) |
60 | 67 | from aegis_memory.client import ( |
|
70 | 77 | ConsolidationCandidate, |
71 | 78 | ) |
72 | 79 |
|
| 80 | + |
| 81 | +def local_client( |
| 82 | + *, |
| 83 | + db_path: str = None, |
| 84 | + openai_api_key: str = None, |
| 85 | + embedding_model: str = None, |
| 86 | + embedding_provider=None, |
| 87 | + signing_key: str = "aegis-local-default-key", |
| 88 | +) -> AegisClient: |
| 89 | + """ |
| 90 | + Create a local-mode AegisClient (SQLite + numpy, no server needed). |
| 91 | +
|
| 92 | + Usage:: |
| 93 | +
|
| 94 | + from aegis_memory import local_client |
| 95 | + client = local_client() |
| 96 | + client.add("User prefers dark mode", agent_id="ui-agent") |
| 97 | + memories = client.query("user preferences", agent_id="ui-agent") |
| 98 | +
|
| 99 | + Args: |
| 100 | + db_path: SQLite database path (default: ~/.aegis/memory.db) |
| 101 | + openai_api_key: OpenAI key for embeddings (or set OPENAI_API_KEY env var). |
| 102 | + If omitted and sentence-transformers is installed, uses local embeddings. |
| 103 | + embedding_model: Override the embedding model name. |
| 104 | + embedding_provider: Custom EmbeddingProvider instance. |
| 105 | + signing_key: HMAC signing key for integrity hashes. |
| 106 | + """ |
| 107 | + return AegisClient( |
| 108 | + mode="local", |
| 109 | + db_path=db_path, |
| 110 | + openai_api_key=openai_api_key, |
| 111 | + embedding_model=embedding_model, |
| 112 | + embedding_provider=embedding_provider, |
| 113 | + ) |
| 114 | + |
73 | 115 | # Smart memory (automatic extraction) |
74 | 116 | from aegis_memory.smart import ( |
75 | 117 | SmartMemory, |
|
103 | 145 | # Core |
104 | 146 | "AegisClient", |
105 | 147 | "AsyncAegisClient", |
| 148 | + "local_client", |
106 | 149 | "Memory", |
107 | 150 | "PlaybookEntry", |
108 | 151 | "SessionProgress", |
|
0 commit comments