MeshOS - A lightweight multi-agent memory system with semantic search
Project description
MeshOS
A lightweight multi-agent memory system for business. Complete with vector search capabilities, built on PostgreSQL and Hasura.
Features
- 🤖 Multi-agent system with lifecycle management
- 🧠 Vector-based memory storage using pgvector
- 🔍 Semantic search with advanced filtering
- 🌳 Rich taxonomy system for memory classification
- 🔗 Memory linking with relationship types
- 🚀 GraphQL API powered by Hasura
- 🛠️ Easy-to-use CLI
- 📚 Python SDK for seamless integration
Quick Start
- Install the package:
pip install mesh-os
- Create a new project:
mesh-os create my-os
cd my-os
- Add your OpenAI API key when prompted, or edit
.env:
OPENAI_API_KEY=your_api_key_here
- Start the services:
mesh-os up
That's it! Your MeshOS instance is now running with:
- PostgreSQL with pgvector at
localhost:5432 - Hasura GraphQL API at
http://localhost:8080/v1/graphql - Hasura Console at
http://localhost:8080/console
Python SDK Usage
from mesh_os import MeshOS
from mesh_os.core.taxonomy import DataType, KnowledgeSubtype
# Initialize the client
os = MeshOS()
# Register an agent
agent = os.register_agent(
name="research-assistant",
description="AI research assistant",
metadata={
"capabilities": ["research", "summarization"],
"model": "gpt-4"
}
)
# Store memories with taxonomy
memory = os.remember(
content="The key insight from the paper is that transformer architectures...",
agent_id=agent.id,
metadata={
"type": DataType.KNOWLEDGE,
"subtype": KnowledgeSubtype.RESEARCH_PAPER,
"source": "arxiv:2312.12345",
"confidence": 0.95,
"tags": ["paper", "transformers", "important"]
}
)
# Link related memories
os.link_memories(
source_id=memory.id,
target_id=other_memory.id,
relationship="related_to",
weight=0.8
)
# Search memories with advanced filters
memories = os.recall(
query="What were the key insights about transformers?",
agent_id=agent.id, # Optional: filter by agent
limit=5,
threshold=0.7, # Similarity threshold
filters={
# Filter by taxonomy
"type": DataType.KNOWLEDGE,
"subtype": KnowledgeSubtype.RESEARCH_PAPER,
# Numeric comparisons
"confidence": {"_gt": 0.8},
# Date/time filters
"created_at": {"_gte": "2024-01-01"},
# Array operations
"tags": {"_contains": ["important"]},
# Nested JSON filters
"metadata": {"_contains": {"source": "arxiv"}}
}
)
# Delete a specific memory
os.forget(memory.id)
# Unregister an agent (and all their memories)
os.unregister_agent(agent.id)
CLI Usage
# Agent Management
mesh-os agent register "assistant" \
--description "Research assistant" \
--metadata '{"model": "gpt-4"}'
mesh-os agent unregister <agent-id>
# Memory Management
mesh-os memory remember "Important insight..." \
--agent-id <agent-id> \
--metadata '{
"type": "knowledge",
"subtype": "research_paper",
"tags": ["important"]
}'
# Memory Linking
mesh-os memory link <source-id> <target-id> \
--relationship "related_to" \
--weight 0.8
mesh-os memory unlink <source-id> <target-id> \
--relationship "related_to"
# Search with filters
mesh-os memory recall "What do you know?" \
--agent-id <agent-id> \
--limit 5 \
--threshold 0.7 \
--filter type=knowledge \
--filter subtype=research_paper \
--filter 'confidence._gt=0.8' \
--filter 'created_at._gte=2024-01-01' \
--filter 'tags._contains=["important"]' \
--filter 'metadata._contains={"source":"arxiv"}'
mesh-os memory forget <memory-id>
# View Memory Connections
mesh-os memory connections <memory-id> \
--relationship "related_to" \
--depth 2
Memory Taxonomy
MeshOS uses a rich taxonomy system to classify memories:
Data Types
KNOWLEDGE: Facts, concepts, and informationACTIVITY: Actions, events, and behaviorsDECISION: Choices, reasoning, and outcomesMEDIA: Images, audio, and other media
Subtypes
Each data type has specific subtypes:
Knowledge
DATASET: Structured data collectionsRESEARCH_PAPER: Academic papers and findingsCONCEPT: Abstract ideas and theoriesFACT: Verified informationOBSERVATION: Direct observations
Activity
USER_INTERACTION: Conversations and exchangesSYSTEM_EVENT: Internal system eventsTASK: Specific actions or jobsPROCESS: Multi-step procedures
Decision
REASONING: Logic and rationaleOUTCOME: Results and consequencesPLAN: Future actionsEVALUATION: Assessments and judgments
Media
IMAGE: Visual contentAUDIO: Sound recordingsVIDEO: Motion picturesDOCUMENT: Rich text and files
Configuration
The .env file supports the following options:
# Required
OPENAI_API_KEY=your_api_key_here
# Optional (defaults shown)
POSTGRES_PASSWORD=mysecretpassword
HASURA_ADMIN_SECRET=meshos
POSTGRES_PORT=5432
HASURA_PORT=8080
HASURA_ENABLE_CONSOLE=true
Architecture
MeshOS is built on:
- PostgreSQL + pgvector: For persistent storage and vector similarity search
- Hasura: For the GraphQL API and real-time subscriptions
- OpenAI: For generating embeddings (using
text-embedding-3-small) - Python: For the SDK and CLI
Development
- Clone the repository:
git clone https://github.com/yourusername/mesh-os.git
cd mesh-os
- Install dependencies:
poetry install
- Run tests:
poetry run pytest
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.
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
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 mesh_os-0.1.0.tar.gz.
File metadata
- Download URL: mesh_os-0.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d18ec993c1fc14408d92d5140a48e6d1f8e965829591b7941c22ecb15f7d7ca1
|
|
| MD5 |
94ca51af3038dae7299a21e7b4799e34
|
|
| BLAKE2b-256 |
c61e6fae27fe5cc81859d34246c50e149248b9cfa132dbedf083b417dc2d4501
|
Provenance
The following attestation bundles were made for mesh_os-0.1.0.tar.gz:
Publisher:
python-publish.yml on Props-Labs/mesh-os
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mesh_os-0.1.0.tar.gz -
Subject digest:
d18ec993c1fc14408d92d5140a48e6d1f8e965829591b7941c22ecb15f7d7ca1 - Sigstore transparency entry: 167710560
- Sigstore integration time:
-
Permalink:
Props-Labs/mesh-os@074b598ced5f4b7db75b99d2a3e5bc8e7c05738d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Props-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@074b598ced5f4b7db75b99d2a3e5bc8e7c05738d -
Trigger Event:
release
-
Statement type:
File details
Details for the file mesh_os-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mesh_os-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7876a6ba05261fc2064c15dfb63d1af1afbe5a38756cc9ba028b69539d7908cf
|
|
| MD5 |
1d9d6e58da212cb4901f3e26fa3d589c
|
|
| BLAKE2b-256 |
df6d0987300f2da87c1fa86063fa973290f9dc1aea17f107c378225e3e8a5e23
|
Provenance
The following attestation bundles were made for mesh_os-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on Props-Labs/mesh-os
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mesh_os-0.1.0-py3-none-any.whl -
Subject digest:
7876a6ba05261fc2064c15dfb63d1af1afbe5a38756cc9ba028b69539d7908cf - Sigstore transparency entry: 167710564
- Sigstore integration time:
-
Permalink:
Props-Labs/mesh-os@074b598ced5f4b7db75b99d2a3e5bc8e7c05738d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Props-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@074b598ced5f4b7db75b99d2a3e5bc8e7c05738d -
Trigger Event:
release
-
Statement type: