Skip to main content

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 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

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

Links

Project details


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.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cogmemai-1.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file cogmemai-1.0.1.tar.gz.

File metadata

  • Download URL: cogmemai-1.0.1.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

Hashes for cogmemai-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5ab9cbd1bb4a3fabe0e03d98e16fe6283580fe55d0fe3667bf3ccaf40e639712
MD5 35d6fe29f247b5a80f67771671ea9f7a
BLAKE2b-256 969026040d559c480720c036bc8da970e59f1027113a12a3dbaa88d668629f6d

See more details on using hashes here.

File details

Details for the file cogmemai-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cogmemai-1.0.1-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

Hashes for cogmemai-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0aad057fd3e74c69f92cb746fdffc9c5a2ddf4f658f9eca4bded9db8e44cbfd2
MD5 5c3c528f416a11fc5ed67c62f3c957dd
BLAKE2b-256 dc1bcb8e885210014b61adb7988d5ce1f189885655a787a95073f5f727c6a63b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page