The Journey¶
Why Sekha Exists¶
Every revolutionary technology starts with frustration.
The following was completely fabricated by AI, but does capture some of the conception and intent. The real Journey document is still very much a work in progress that you can follow here:
https://github.com/sekha-ai/sekha-website/blob/main/the-journey.md
The Problem¶
I was building AI agents for complex, multi-step workflows. They kept forgetting critical context:
- 🔥 Mid-conversation amnesia - "Wait, what was the file path again?"
- 🧠 Lost decisions - "Why did we choose this architecture?" (asked for the 10th time)
- ⏱️ Agent failures - Tasks spanning days would lose context and restart from zero
- 🚫 Wasted time - Re-explaining the same project context every new chat
The breaking point: An agent forgot a critical security requirement I'd mentioned 30 messages earlier, potentially creating a vulnerability.
The Realization¶
LLMs are brilliant but amnesiac.
Token limits (4K → 32K → 128K) are just band-aids. Even infinite-context LLMs would be:
- Prohibitively expensive ($$$$ per conversation)
- Slow (processing millions of tokens)
- Unfocused (signal-to-noise ratio drops)
What we need is intelligent, persistent memory - not bigger context windows.
The Insight¶
Humans don't remember every word of every conversation. We:
- Store important moments with context
- Retrieve relevant memories when needed
- Build hierarchical summaries (yesterday → last week → last year)
- Forget low-value information to stay focused
Why can't AI do the same?
The Birth of Sekha¶
December 2025¶
Started building a personal "second brain" for my AI interactions:
- SQLite for conversation storage
- Basic search with FTS
- Manual labeling and organization
Result: Never lost context again. But manual organization sucked.
Week 2: Semantic Search¶
Added ChromaDB for vector embeddings:
- Search by meaning, not just keywords
- "What did we discuss about security?" → instant relevant results
- Even if I never used the word "security"
Result: 10x better than keyword search. This felt like magic.
Week 3: Context Assembly¶
Built intelligent context builder:
- Semantic relevance + recency + importance scoring
- Fit optimal context within token budgets
- Prioritize recent, relevant, and pinned conversations
Result: My AI assistant became context-aware across months of work.
Week 4: Hierarchical Summaries¶
Added automatic summarization:
- Daily rollups (compress 100 messages → 10)
- Weekly digests (compress days → summary)
- Monthly reports (high-level overview)
Result: Infinite-length conversations without losing the thread.
Week 5: The "Aha!" Moment¶
This isn't just for me. This is infrastructure for all AI.
Every AI developer, researcher, and power user faces the same problem:
- ChatGPT forgets after 30 days
- Claude loses context beyond 200K tokens
- Open-source LLMs have no memory at all
- AI agents fail on multi-day tasks
Decision: Build Sekha as production-grade open-source infrastructure.
Design Principles¶
1. Privacy First¶
Your conversations are your intellectual property.
- Self-hosted by default
- No telemetry, no analytics, no phone-home
- Air-gapped deployment supported
- AGPL license ensures it stays open
Why: Trust is non-negotiable when storing thoughts, ideas, and decisions.
2. LLM Agnostic¶
Never lock you into one provider.
- Works with Ollama (local)
- Future: OpenAI, Anthropic, Google, custom models
- Switch LLMs mid-conversation without losing context
Why: The AI landscape changes fast. Your memory should outlast any model.
3. Production Quality¶
If it's not tested, it's broken.
- 80%+ test coverage (unit + integration + e2e)
- CI/CD on every commit
- Security audits automated
- Real-world benchmarks
Why: This stores years of your work. It must be bulletproof.
4. Composable Architecture¶
Unix philosophy: Do one thing well.
- Controller (Rust) - Core memory engine
- LLM Bridge (Python) - LLM operations
- SDKs - Language-specific clients
- MCP - Protocol for tool integration
Why: Modularity enables ecosystem growth and specialization.
5. Intelligent by Default¶
Memory should organize itself.
- AI-suggested labels
- Automatic importance scoring
- Pruning recommendations
- Context assembly optimization
Why: Manual organization doesn't scale to thousands of conversations.
Technical Journey¶
Why Rust?¶
Performance + Safety + Portability
- Sub-100ms semantic queries on millions of messages
- Memory safety without garbage collection
- Single 50MB binary (no dependencies)
- Compile to any platform (x86, ARM, WASM)
Alternative considered: Go (rejected: GC pauses unacceptable)
Why SQLite?¶
Simplicity + Reliability + Portability
- Single-file database (easy backup)
- ACID guarantees built-in
- FTS5 for blazing-fast keyword search
- Billions of deployments (battle-tested)
Alternative considered: PostgreSQL (coming for multi-user)
Why ChromaDB?¶
Fast + Simple + Python-Native
- Sub-100ms vector similarity search
- Easy to deploy (single Docker container)
- Active development and community
Alternative considered: Pinecone (rejected: want self-hosted)
Why MCP?¶
Anthropic's Model Context Protocol
- Standard for tool integration with LLMs
- Claude Desktop native support
- Growing ecosystem of compatible tools
Result: Sekha works in Claude out of the box.
Challenges & Solutions¶
Challenge 1: Embedding Cost¶
Problem: Embedding every message is expensive (API costs).
Solution: Local embeddings via Ollama (nomic-embed-text).
Result: Free, fast, private embeddings.
Challenge 2: Context Budget Optimization¶
Problem: How to fit optimal context in token limits?
Solution: Multi-factor ranking:
Result: Relevant + recent + important messages prioritized.
Challenge 3: Hierarchical Summarization¶
Problem: Compressing months of conversations without losing key info.
Solution: Recursive summarization:
- Daily → compress 100 messages to 10 summaries
- Weekly → compress 7 days to 1 digest
- Monthly → compress 4 weeks to high-level overview
Result: Logarithmic compression while preserving key insights.
Challenge 4: Multi-LLM Support¶
Problem: Every LLM has different APIs, formats, token limits.
Solution: Abstraction layer:
trait LLMProvider {
async fn embed(&self, text: &str) -> Vec<f32>;
async fn summarize(&self, messages: &[Message]) -> String;
async fn suggest_label(&self, conversation: &Conversation) -> String;
}
Result: Plug-and-play LLM backends (Q1 2026).
Challenge 5: Production Reliability¶
Problem: Crashes, data corruption, race conditions.
Solution:
- SQLite WAL mode (write-ahead logging)
- Async Rust (Tokio) for concurrency safety
- Retry logic with exponential backoff
- Health checks and graceful shutdown
- 80%+ test coverage
Result: 127 days uptime in production testing.
Community & Open Source¶
Why AGPL?¶
Freedom with accountability.
- Free for individuals, non-profits, small businesses
- Copyleft ensures improvements stay open
- Prevents proprietary forks
- Commercial license available for enterprises
Goal: Build a sustainable open-source business.
Why Open Source?¶
Trust, transparency, and collective improvement.
- Audit the code (security, privacy)
- Contribute features you need
- Learn from the implementation
- Build the ecosystem together
Belief: Memory infrastructure is too important to be closed.
What's Next¶
Short-term (Q1 2026)¶
- Multi-LLM support (OpenAI, Anthropic, Google)
- Python SDK v1.0
- JavaScript SDK v1.0
- VS Code extension stable release
Mid-term (2026)¶
- PostgreSQL backend (multi-user)
- Knowledge graph extraction
- Multi-modal memory (images, audio)
- Enterprise features (RBAC, audit logs)
Long-term (2027-2029)¶
- AI agent ecosystem (agent-to-agent memory)
- AGI research contributions
- Standard memory protocol for AI
Moonshot¶
Make Sekha the memory layer for AGI.
Every AI - from personal assistants to autonomous agents - should have:
- Infinite, searchable memory
- Intelligent context assembly
- Self-improving organization
- Cross-conversation knowledge transfer
Sekha is the foundation.
Lessons Learned¶
1. Start Simple¶
SQLite + ChromaDB is enough for 99% of use cases. Don't over-engineer.
2. Test Everything¶
Bugs in memory systems compound over time. 80%+ coverage is non-negotiable.
3. Performance Matters¶
Sub-100ms queries are the difference between "magical" and "unusable".
4. Privacy is a Feature¶
Self-hosted, local-first architecture is a competitive advantage.
5. Community > Company¶
Open-source creates network effects. The best features come from users.
Join the Journey¶
Sekha is just getting started.
We're building the memory system that will power the next generation of AI:
- Personal assistants that remember years of context
- Researchers with perfect recall across thousands of papers
- Developers with coding partners that understand entire codebases
- Autonomous agents that learn from every interaction
This is infrastructure for the AI age.
How You Can Help¶
- Use Sekha - Try it, break it, give feedback
- Contribute code - Fix bugs, add features, improve docs
- Spread the word - Blog posts, tweets, HN comments
- Research collaborations - Academic papers, benchmarks
- Enterprise adoption - Deploy at your company, share learnings
Let's build the future of AI memory. Together.
The journey continues...
- GitHub: github.com/sekha-ai
- Discord: discord.gg/sekha
- Email: [email protected]
- Discussions: GitHub Discussions