CogmemAi — Persistent memory for AI coding assistants
Project description
CogmemAi Python SDK
Persistent memory for AI coding assistants. Give your AI tools memory that persists across sessions.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cogmemai-1.0.0.tar.gz
(5.9 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 cogmemai-1.0.0.tar.gz.
File metadata
- Download URL: cogmemai-1.0.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8caeadc3edbfbf66bb679c8e75d4fd85f00926ab34cf9bcba1cab9aef2cc20ab
|
|
| MD5 |
2fd41c4259351e94fdb3c60d6fc3ade6
|
|
| BLAKE2b-256 |
1a836e0e619da940e19f262547f7ddc0c093b5dad875b9dc6a5464f09e9c0aab
|
File details
Details for the file cogmemai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cogmemai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
611cb4aa3cf7b7f45ec5c41eef8c7ff684926bb316ccd9af76f8171be4fdf225
|
|
| MD5 |
04b7c99dc19ca9de2ccb31e927748b7a
|
|
| BLAKE2b-256 |
5034c336ea1a08971fc94cf033da694cce981f33a7ba2efd3acebfb6cb9392a0
|