CogmemAi Python SDK
The smart memory layer for everything Ai. Persistent, encrypted recall for any Ai system: agents, assistants, robots, and the tools you already use. 95.10% on LongMemEval, the highest published score.
Install
pip install cogmemai
Quick Start
from cogmemai import CogmemAi
client = CogmemAi("cm_your_api_key_here")
# Save a memory
client.save_memory(
content="This project uses React with TypeScript",
memory_type="architecture",
category="frontend",
importance=8,
)
# Search memories
results = client.recall_memories("what framework does this project use?")
for memory in results["memories"]:
print(f"[{memory['importance']}] {memory['content']}")
# Load project context
context = client.get_project_context(project_id="my-project")
# Extract memories from conversation
client.extract_memories(
user_message="Let's use PostgreSQL for the database",
assistant_response="Good choice. I'll set up the schema with...",
)
All Methods
Core Memory
save_memory(content, memory_type, category, subject, importance, scope, project_id), Save a memoryrecall_memories(query, limit, memory_type, scope), Semantic searchextract_memories(user_message, assistant_response, previous_context), Ai extracts facts from conversationget_project_context(project_id, include_global, context), Load top memories with smart rankinglist_memories(memory_type, category, scope, limit, offset), Browse with filtersupdate_memory(memory_id, content, importance, scope), Edit a memorydelete_memory(memory_id), Delete permanentlyget_usage(), Check usage stats and tier
Documents & Sessions
ingest_document(text, document_type, project_id), Extract memories from docssave_session_summary(summary, project_id), Capture session accomplishments
Import / Export
export_memories(), Back up memories as JSONimport_memories(memories), Bulk import from JSONget_memory_versions(memory_id), Version history
Team & Collaboration
get_team_members(project_id), List team membersinvite_team_member(email, project_id, role), Invite a memberremove_team_member(member_id), Remove a member
Memory Relationships & Promotion
link_memories(memory_id, related_memory_id, relationship_type), Link related memoriesget_memory_links(memory_id), Get linked memoriesget_promotion_candidates(), Find cross-project patternspromote_to_global(memory_id), Promote to global scope
Error Handling
from cogmemai.client import CogmemAiError
try:
client.save_memory(content="test")
except CogmemAiError as e:
print(f"Error {e.status_code}: {e}")
Get an API Key
- Sign up at hifriendbot.com/developer/
- Generate an API key
- Start saving memories
Links
Metadata
Release files for cogmemai 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cogmemai-1.0.2.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cogmemai-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / cogmemai-1.0.2.tar.gz
| Download URL | cogmemai-1.0.2.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
758a6375329299825a56eba9238f3b6415e6d4e6e7d85b61e5f0cbf2e8120bee
|
|
BLAKE2b-256 checksum How to use checksums |
68af8278c2c5a67cdc94e74669d266a618c8f36a66095e463b38a381f2d43aad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / cogmemai-1.0.2-py3-none-any.whl
| Download URL | cogmemai-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3c85875bdb60aee273ec150edde8239932d6c6cf537b7c5c7cae5b501cf8eac
|
|
BLAKE2b-256 checksum How to use checksums |
974a31eec3a82eaf766785a79ae82ee2fb91869e50837f758785685bbde8635a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|