An online encyclopedia, with its articles generated by LLMs. You may even say that this is the true open source Grokipedia.
- Bun 1.3.x+
- OpenRouter API key
- Tavily API key (can someone provide a fully free and good search engine for the agent?)
- PostgreSQL database
git clone https://github.com/frolleks/cognipedia && cd cognipedia
cp ./article-creator-agent/.env.example ./article-creator-agent/.env
cp ./app/.env.example ./app/.env
Then fill in the environment variables with their values respectively.
For the article-creator-agent, you can customize which LLM to use to whatever that's available in OpenRouter.
cd app && bun run db:generate
For some reason, drizzle-kit doesn't generate SQL for the enums, so you must add it manually to the migration file:
-- in app/drizzle/0000_xxx.sql
CREATE TYPE article_status AS ENUM ('draft', 'review', 'published', 'archived');
Then migrate to the database:
bun run db:migrate && cd ..
Using the article-creator-agent, you can generate articles by running:
bun run ./article-creator-agent/index.ts "any topic you'd want to generate an article on"
You can do this operation multiple times.
After that, you can ingest the articles to the database:
cd app && bun run ingest:dump
The code that runs Cognipedia is licensed under GPL-3.0, while the articles... I'm not really sure.
.png)