A memory-augmented framework for LLMs
Project description
🦙 Llamate
A memory-augmented agent framework for LLMs.
Quick Start
Follow these steps to set up, use, and view data in Llamate with PostgreSQL:
1. Install Llamate
pip install llamate
2. Start PostgreSQL Container
docker run --name llamate-postgres -e POSTGRES_USER=llamate -e POSTGRES_PASSWORD=llamate -e POSTGRES_DB=llamate -p 5432:5432 -d ankane/pgvector
3. Initialize Llamate
llamate --init
# Select 'postgres' as your vector store backend
# Enter connection string: postgresql://llamate:llamate@localhost:5432/llamate
4. Run a Test Script to Store Data
Create a file test_llamate.py:
from llamate import MemoryAgent, get_vectorstore_from_env
import os
# Set user ID
user_id = "test_user"
# Initialize components
vectorstore = get_vectorstore_from_env(user_id=user_id)
agent = MemoryAgent(user_id=user_id, vectorstore=vectorstore)
# Add memories
agent.chat("The capital of France is Paris.")
agent.chat("The Eiffel Tower is 324 meters tall.")
agent.chat("Python is a programming language created by Guido van Rossum.")
# Test retrieval
response = agent.chat("Tell me about Paris.")
print("Response:", response)
5. View Data in PostgreSQL
Connect to the database:
docker exec -it llamate-postgres psql -U llamate -d llamate
List tables to find your memory table (it will use your user_id):
\dt
View table structure:
\d memory_test_user
Display memory records (omitting the large vector field):
SELECT id, text FROM memory_test_user;
Count records:
SELECT COUNT(*) FROM memory_test_user;
Query specific memories (using text search):
SELECT id, text FROM memory_test_user WHERE text LIKE '%Paris%';
Delete test memories (if needed):
DELETE FROM memory_test_user WHERE text LIKE '%test%';
Exit the PostgreSQL shell:
\q
Features
- Persistent memory for AI using vector embeddings
- Multiple vector store backends (FAISS and PostgreSQL)
- Easy integration into existing applications
- Simple CLI for testing and demonstration
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 llamate-0.1.1.tar.gz.
File metadata
- Download URL: llamate-0.1.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94c0a989a884784b0ddd9e2b11e592820aa3d9699e4b02fa4460435d9bc2b462
|
|
| MD5 |
2c689790e7a42cf8297209455e9afb9d
|
|
| BLAKE2b-256 |
d103bd2c7101834f347005f9898459b408941fb7ef5dbfcaeca6da12373f4d6d
|
File details
Details for the file llamate-0.1.1-py3-none-any.whl.
File metadata
- Download URL: llamate-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa4bc03b2bfa0d50e52ebfc2211253533ec575ea58bfa6ab7deeae96e7b51858
|
|
| MD5 |
b8d3e31b4bf211e7abb8229cc56fde59
|
|
| BLAKE2b-256 |
7727a737fc3a0233a3e0f405c800bf519c4e4278116b1f24c546b01c9379cdc9
|