Skip to content

gloggers99/cogito_api

Repository files navigation

cogito_api

Codacy Badge

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.

Setup

Dependencies

  • Cargo (for building and testing cogito_api)
  • Docker
  • Protocol Buffer Compiler (protoc)

Steps

  • Create a .env file. (or copy the provided .env.example to .env)
    cp ./.env.example ./.env
    It should follow this format. Everything uncommented is required for cogito_api to 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

OpenAPI

The OpenAPI documentation is available at /redoc when the server is running. These docs are generated using the utoipa and utoipa-redoc rust crates.

Additional Information

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

About

The API for cogito, an AI philosophy research tool.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors