This is the backend for Cogito, a Q&A style agentic philosophy research tool envisioned by William Chastain and powered by this API, written in whole by Lucas Marta.
This API handles user data and connects to the AI service component of Cogito (CrazyWillBear/cogito-ai) using gRPC.
This is a HUGE work in progress.
- Cargo (for building and testing
cogito_api) - Docker
- Protocol Buffer Compiler (
protoc)
- Create a
.envfile. (or copy the provided.env.exampleto.env)It should follow this format. Everything uncommented is required forcp ./.env.example ./.env
cogito_apito function.# ./.env # Database credentials. POSTGRES_USER=postgres POSTGRES_PASSWORD=password POSTGRES_DB=cogito_db # Optional IP & port to bind the API service to. # If this does not exist the default will be "127.0.0.1:8080" COGITO_API_URL=127.0.0.1:8080 # The IP & port of the Cogito agent. COGITO_AGENT_URL=127.0.0.1:9999
- Finally start the API:
# This will start both the api and the database. docker compose up -d
The OpenAPI documentation is available at /redoc when the server is running. These docs are generated using the
utoipa and utoipa-redoc rust crates.
This repository is fully implemented by me and serves as an opportunity to demonstrate the range of technologies and practices I'm working to master.
The AI agent component that this API interacts with is being developed independently by Will here.
Primary technologies demonstrated in this repository:
- Rust
- PostgreSQL
- Docker
- gRPC
- OpenAPI