Skip to main content

Memory system for AI agents with Structured RAG, built on TypeAgent

Project description

Fork Changes

I've been keeping an eye on this repo for a while. I'm also personally interested in personal assistant agents, and I've been trying to find best practices for memory. Structured RAG is a great design, but since this is an experimental project, the feature set isn't complete yet. So I forked the original repo and added more features, aiming to make it work for more general use cases and projects.

This fork adds Momex - a high-level API wrapper for TypeAgent's Structured RAG.

What's New

  • Agent API - High-level chat interface with automatic memory management
  • Short-term memory - Session-based conversation history with persistence
  • Long-term memory - Structured RAG with entity/action/topic extraction
  • Multi-tenant support with hierarchical collections (user:xiaoyuzhang)
  • PostgreSQL backend with pgvector for production deployment

Installation

pip install momex

Quick Start

import asyncio
from momex import Agent, MomexConfig, LLMConfig

async def main():
    config = MomexConfig(
        llm=LLMConfig(
            provider="openai",
            model="gpt-4o",
            api_key="sk-xxx",
        ),
    )

    agent = Agent("user:xiaoyuzhang", config)

    r = await agent.chat("My name is Xiaoyu, I love Python")
    print(r.content)

    r = await agent.chat("What's my name?")
    print(r.content)  # "Your name is Xiaoyu"

asyncio.run(main())

Two API Levels

Level API Description
Level 1 Agent Chat API with automatic memory (recommended)
Level 2 Memory Manual control for custom agents

See docs/momex.md for full documentation.


Python package 'typeagent'

This is an experimental prototype

Working toward a shared understanding of the MVP for structured RAG.

This is sample code

This is an in-progress project aiming at a Pythonic translation of TypeAgent KnowPro and a few related packages from TypeScript to Python.

Warning

This library will send its input to an LLM hosted by a third party. Don't use it to index confidential information.

Documentation

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

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

momex-0.1.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

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

momex-0.1.1-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file momex-0.1.1.tar.gz.

File metadata

  • Download URL: momex-0.1.1.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for momex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0909b9804f35bfc2cbfb3c5cb5ca5dc92182d4d62574473010c129cd939a55df
MD5 4905f774f49f213bdd7b2059aea64341
BLAKE2b-256 0154aa2eb3d55ff0b25474a3e4f8e01ef519ddd3c081e8449da3e8f11012423c

See more details on using hashes here.

File details

Details for the file momex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: momex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for momex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77cbe1c4463cf5e17104dab80040781118bf61d1400cd44bf316a29cd4f41963
MD5 ce5b83f4b159beaa08a558b883813b72
BLAKE2b-256 60145d3bc2c601af1b108fe1b9b5b64d654ae2f06b4c747fc37588b699b023f1

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