Skip to main content

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. Holds the top published score on LongMemEval (the result).

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 memory
  • recall_memories(query, limit, memory_type, scope), Semantic search
  • extract_memories(user_message, assistant_response, previous_context), Ai extracts facts from conversation
  • get_project_context(project_id, include_global, context), Load top memories with smart ranking
  • list_memories(memory_type, category, scope, limit, offset), Browse with filters
  • update_memory(memory_id, content, importance, scope), Edit a memory
  • delete_memory(memory_id), Delete permanently
  • get_usage(), Check usage stats and tier

Documents & Sessions

  • ingest_document(text, document_type, project_id), Extract memories from docs
  • save_session_summary(summary, project_id), Capture session accomplishments

Import / Export

  • export_memories(), Back up memories as JSON
  • import_memories(memories), Bulk import from JSON
  • get_memory_versions(memory_id), Version history

Team & Collaboration

  • get_team_members(project_id), List team members
  • invite_team_member(email, project_id, role), Invite a member
  • remove_team_member(member_id), Remove a member

Memory Relationships & Promotion

  • link_memories(memory_id, related_memory_id, relationship_type), Link related memories
  • get_memory_links(memory_id), Get linked memories
  • get_promotion_candidates(), Find cross-project patterns
  • promote_to_global(memory_id), Promote to global scope

Guard & Review (the memory that says no, and checks the work)

  • guard_check(action, kind=, context=, project_id=), Ask before acting: allow, ask or deny against remembered rules and the intent
  • review_work(work, intent=, project_id=), Review finished work (a description, output, message or transcript) against the intent
  • get_intent(project_id), Read the project intent document
  • set_intent(project_id, content, changed_by=), Write the project intent document

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

  1. Sign up at hifriendbot.com/developer/
  2. Generate an API key
  3. Start saving memories

Metadata

Release files for cogmemai 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cogmemai 1.1.2
File Size Uploaded Provenance Actions
cogmemai-1.1.2.tar.gz 48.6 kB Without provenance Details for cogmemai-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cogmemai 1.1.2
File Interpreter ABI Platform Actions
cogmemai-1.1.2-py3-none-any.whl Python 3 none any Details for cogmemai-1.1.2-py3-none-any.whl

Total release size: 56.8 kB

Release files / cogmemai-1.1.2.tar.gz

Download URL cogmemai-1.1.2.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e770363755ba25eafb63503496a7690988e975d04930b9d1c9c7e469bed11f73
BLAKE2b-256 checksum
How to use checksums
17a226d02c499371d35a8baa67e87c64c5ba08b8f586a65f44f74336872ac09a
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.1.2-py3-none-any.whl

Download URL cogmemai-1.1.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ffabb2bf1750dac1a5b7a7ae053db0db0f26423b495b447b58ea8c8a16e250
BLAKE2b-256 checksum
How to use checksums
cbe125175361960dc538b9c878430cf462b703567666a29114b39cf8b18bf3e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for cogmemai 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page