Deploy AI Memory on PostgreSQL in 60 Seconds
The fastest way to add persistent memory to your AI application. Three commands, one PostgreSQL database, sub-5ms latency. No Qdrant, no Neo4j, no complexity.
The 3-Command Deploy
Stop reading blog posts about complex AI memory architectures. Here is a working memory system in 60 seconds:
git clone https://github.com/aiknol/knol.git
cd knol
docker compose up -dThat is it. You now have a running memory system with vector search, knowledge graphs, full-text search, and 4 types of memory. Let us use it.
Store Your First Memory
curl -X POST http://localhost:3000/v1/memory \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"content": "User prefers dark mode and uses VS Code",
"user_id": "user_123"
}'Knol automatically extracts structured facts from the content, generates vector embeddings, and updates the knowledge graph. All in one API call.
Search Memories
curl http://localhost:3000/v1/memory/search \
-H "Authorization: Bearer your-api-key" \
-d '{
"query": "What editor does this user prefer?",
"user_id": "user_123",
"limit": 5
}'The search uses hybrid retrieval — vector similarity, BM25 keyword matching, and knowledge graph traversal — fused together for the best results. Response time: under 5ms.
Connect Your AI Application
from knol import KnolClientclient = KnolClient( api_url="http://localhost:3000", api_key="your-api-key" )
# Store memory from a conversation client.episodic.add( content="User asked about deploying to AWS ECS", user_id="user_123" )
# Retrieve context for the next response context = client.retrieve( query="What cloud platform does this user use?", user_id="user_123" ) ```
Why PostgreSQL Only?
Most AI memory systems require you to deploy 3-4 separate databases: one for vectors (Qdrant, Pinecone), one for graphs (Neo4j), one for search (Elasticsearch), and one for metadata (PostgreSQL). That is a lot of infrastructure for storing user preferences.
Knol uses PostgreSQL with the pgvector extension. Vectors, graphs, full-text search, and relational data all live in one database. One backup strategy, one set of credentials, one connection pool.
What You Get Out of the Box
The Docker Compose includes everything: Gateway service for API routing, Write service for memory ingestion, Retrieve service for hybrid search, Graph service for entity extraction, PostgreSQL with pgvector for all data, Redis for caching, and NATS for async processing.
Total memory footprint: under 512MB. Compare that to running Qdrant + Neo4j + Redis + PostgreSQL separately.
Next Steps
Once you have memories flowing, explore LangChain integration, the MCP server for Claude Desktop, knowledge graph queries, memory decay for automatic relevance scoring, and the admin dashboard for monitoring.
All documentation is at docs.aiknol.com. The project is open-source on GitHub.