# second-brain-agent

> second-brain-agent is an open-source agent for knowledge and memory. Self-hosted indexing of markdown notes, PDFs and links for AI question answering. It is available on CLI, Self-hosted, Linux and API.

- **Kind:** Agent
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, Linux, API
- **Repository:** https://github.com/flepied/second-brain-agent
- **GitHub stars:** 314
- **License:** GPL-3.0
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-01

## About

Rather than searching a folder of notes by filename, this project watches a directory of markdown files and builds a searchable index that includes the PDFs, web pages and YouTube videos those notes link to. Changes to files are picked up automatically, so the index stays current as you edit in your notes app.

The index is built with LangChain and a ChromaDB vector store, and questions are answered with OpenAI language models. Notes can be grouped into domains derived from file names, and a mapping document lets you separate work and personal material when searching.

Access goes through a bundled MCP server, so an AI client such as an MCP-compatible editor or chat app can pull relevant passages from your notes. It is aimed at people who keep their own markdown knowledge base and are comfortable running Python, uv and Docker on Linux.

## Features

- **Automatic note indexing:** Watches a markdown directory and reprocesses files as they change.
- **Linked content extraction:** Pulls text from local and remote PDFs, web pages, YouTube videos and file URLs referenced in notes.
- **Vector search:** Stores chunk embeddings in ChromaDB for semantic retrieval across notes.
- **MCP server access:** Exposes search and document tools to MCP-compatible AI clients.
- **Domain-based filtering:** Derives domains from file names and uses a mapping document to scope searches.
- **Journal and history parsing:** Splits journal-style files by date headings to support activity reports.
- **Command-line search:** Offers a terminal helper that prints top matches with their source files.

## Good for

- Asking questions across years of personal markdown notes
- Letting an AI assistant pull context from your own research notes
- Searching saved PDFs and bookmarked web pages referenced in notes
- Separating work and personal knowledge when querying an archive
- Generating date-based activity summaries from journal files

## FAQ

### Which language model does second-brain-agent use?

It uses OpenAI large language models to answer questions about your content.

### Which operating systems has second-brain-agent been tested on?

It has been tested on Fedora Linux 42 and Ubuntu in CI workflows.

### How is the vector database run?

The Chroma server runs in Docker, and the repository includes a compose file that bind-mounts its data directory.

### What license does second-brain-agent use?

The project is licensed under GPL-3.0.

### Is second-brain-agent free?

Yes. second-brain-agent is open source, so you can use and self-host it for free.

### What are the best alternatives to second-brain-agent?

The closest alternatives to second-brain-agent are GitHub, LazyMind, hindsight, OpenViking and MaxKB.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [GitHub](https://ai-powered.com/agents/github-21): GitHub is a freemium hosted agent for developer tools.
- [LazyMind](https://ai-powered.com/agents/lazymind): LazyMind is an open-source agent for knowledge and memory.
- [hindsight](https://ai-powered.com/agents/hindsight-2): hindsight is an open-source agent framework for knowledge and memory.
- [OpenViking](https://ai-powered.com/agents/openviking): OpenViking is an open-source agent for knowledge and memory.
- [MaxKB](https://ai-powered.com/agents/maxkb): MaxKB is an open-source agent for knowledge and memory.
- [GitHub](https://ai-powered.com/agents/github-13): GitHub is an open-source agent framework for developer tools.
- [llm-for-zotero](https://ai-powered.com/agents/llm-for-zotero): llm-for-zotero is an open-source agent for research.
- [CheeseDB](https://ai-powered.com/agents/cheesedb): CheeseDB is an open-source agent framework for databases.

---
Source: https://ai-powered.com/agents/second-brain-agent
